﻿//
// Created by francklinson on 2021/3/16.
//
#include <iostream>

using namespace std;
struct box
{
    char maker[40];
    float height;
    float width;
    float length;
    float volume;
};

void showBox(box);

void calVolume(box *);

int main()
{


    box bb{"China", 10, 20, 40, 0};
    showBox(bb);
    calVolume(&bb);
    showBox(bb);
    return 0;
}

void showBox(box b)
{
    cout << "maker: " << b.maker << endl;
    cout << "height: " << b.height << endl;
    cout << "width: " << b.width << endl;
    cout << "length: " << b.length << endl;
    cout << "volume: " << b.volume << endl;
}

void calVolume(box *b)
{
    b->volume = b->height * b->length * b->width;
}
